#ifndef UI_H
#define UI_H

#include <ostream>
#include <string>
#include <list>
#include "discinfo.h"

class Ui
{
	public:
  enum end { END };

	enum lvl_t
	{
    ERROR,
    NOTICE,
    VERBOSE,
    DEBUG
  };

	Ui& msg(const lvl_t lvl, const std::string who = "");
	void operator<<(const end);
	Ui& operator<<(const std::string&);
	Ui& operator<<(const int&);
	Ui& operator<<(const char*);

	virtual void mainloop() = 0;
	virtual std::list<disc_t>::const_iterator chooseDisc(const std::list<disc_t>& matches) = 0;
  void setMsgLevel(lvl_t);

	protected:
  lvl_t output_msglvl;
	virtual void log(const lvl_t lvl, const std::string who, const std::string what) = 0;

	private:
	lvl_t msglvl;
	std::string msgfrom;
	std::string msgdata;
};

extern Ui* G_ui;

#endif /* UI_H */
